﻿using System;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Graphics;
using ZSoft.PushServices.Android;
using Android.Widget;

namespace AndClient
{
    [Activity(Label = "Simple", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        //Button button;
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            
            SetContentView(Resource.Layout.Main);
            Button button = (Button)FindViewById(Resource.Id.FirstButton);
            
            button.Click += Button_Click;
        }
        public void Button_Click(object sender, EventArgs e)
        {
          //  button.Text += "1";
            Toast.MakeText(this, "Hello world", ToastLength.Long);
            StartService(new Intent(this, typeof(BackgroundService)));
        }

        private void Create()
        {
            Bitmap b = null;
            Notification.Builder builder = new Notification.Builder(this)
                .SetTicker("Sample Notification")
                    .SetContentTitle("Sample Notification")
                        .SetContentText("some text as  content")
                            .SetSmallIcon(Resource.Drawable.Icon)
                             .SetLargeIcon(b);

            Notification notification = builder.Build();
            NotificationManager manager = GetSystemService(Context.NotificationService) as NotificationManager;
            int id = 0;
            manager.Notify(id, notification);
        }
    }
}

